home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 0186 / vc.zip / VCVIEW.CPP < prev    next >
C/C++ Source or Header  |  1996-01-15  |  2KB  |  91 lines

  1. // vcview.cpp : implementation of the CVcView class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "vc.h"
  6.  
  7. #include "vcdoc.h"
  8. #include "vcview.h"
  9.  
  10. #ifdef _DEBUG
  11. #undef THIS_FILE
  12. static char BASED_CODE THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CVcView
  17.  
  18. IMPLEMENT_DYNCREATE(CVcView, CFormView)
  19.  
  20. BEGIN_MESSAGE_MAP(CVcView, CFormView)
  21.     //{{AFX_MSG_MAP(CVcView)
  22.     ON_VBXEVENT(VBN_CLICK, IDC_TOGGLE1, OnClickToggle1)
  23.     //}}AFX_MSG_MAP
  24. END_MESSAGE_MAP()
  25.  
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CVcView construction/destruction
  28.  
  29. CVcView::CVcView()
  30.     : CFormView(CVcView::IDD)
  31. {
  32.     //{{AFX_DATA_INIT(CVcView)
  33.     m_toggle1 = NULL;
  34.     //}}AFX_DATA_INIT
  35.     // TODO: add construction code here
  36. }
  37.  
  38. CVcView::~CVcView()
  39. {
  40. }
  41.  
  42. void CVcView::DoDataExchange(CDataExchange* pDX)
  43. {
  44.     CFormView::DoDataExchange(pDX);
  45.     //{{AFX_DATA_MAP(CVcView)
  46.     DDX_Control(pDX, IDC_EDIT1, m_edit1);
  47.     DDX_VBControl(pDX, IDC_TOGGLE1, m_toggle1);
  48.     //}}AFX_DATA_MAP
  49. }
  50.  
  51. /////////////////////////////////////////////////////////////////////////////
  52. // CVcView diagnostics
  53.  
  54. #ifdef _DEBUG
  55. void CVcView::AssertValid() const
  56. {
  57.     CFormView::AssertValid();
  58. }
  59.  
  60. void CVcView::Dump(CDumpContext& dc) const
  61. {
  62.     CFormView::Dump(dc);
  63. }
  64.  
  65. CVcDoc* CVcView::GetDocument() // non-debug version is inline
  66. {
  67.     ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CVcDoc)));
  68.     return (CVcDoc*)m_pDocument;
  69. }
  70. #endif //_DEBUG
  71.  
  72. /////////////////////////////////////////////////////////////////////////////
  73. // CVcView message handlers
  74.  
  75. void CVcView::OnClickToggle1(UINT, int, CWnd*, LPVOID)
  76. {
  77. long option;
  78. char str[5];
  79.                  
  80.     option=m_toggle1->GetNumProperty("Value");
  81.     if (option) {             
  82.         sprintf(str,"%s",m_toggle1->GetStrProperty("OnCaption"));
  83.         }
  84.     else {
  85.         sprintf(str,"%s",m_toggle1->GetStrProperty("OffCaption"));
  86.         }                                        
  87.         
  88.     m_edit1.SetWindowText(str);  
  89.  
  90. }
  91.